import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class BlueInfo extends StatefulWidget {
  @override
  _BlueInfoState createState() => _BlueInfoState();
}

class _BlueInfoState extends State<BlueInfo> {
  @override
  void initState() {
    super.initState();
    SystemChrome.setPreferredOrientations([
      DeviceOrientation.portraitUp,
      DeviceOrientation.portraitUp,
    ]);
  }

  @override
  void dispose() {
    super.dispose();
    SystemChrome.setPreferredOrientations([
      DeviceOrientation.landscapeLeft,
      DeviceOrientation.landscapeLeft,
    ]);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        elevation: 1.0,
        titleSpacing: 0.0,
        backgroundColor: Theme.of(context).canvasColor,
        title: Text(
          "功能说明",
          style: TextStyle(fontSize: 18),
        ),
      ),
      body: Container(
        padding: EdgeInsets.all(10),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Text(
              "本功能暂时只支持经典蓝牙(蓝牙2.0)，低功耗蓝牙后期考虑兼容。测试设备：HC-05",
              style: TextStyle(
                color: Color(0xffFF9641),
                fontSize: 12,
              ),
            ),
            SizedBox(height: 10),
            Text(
              "1、每个按键对应不同的键值，蓝牙连接成功后按下发送相应的键值，默认键值以FF开头，中间“发送键值”下方显示的是按下后发送出去的值。",
              style: TextStyle(
                color: Color(0xff333333),
              ),
            ),
            SizedBox(height: 10),
            Text(
              "2、中间“收到数据”显示以&开头并且以&结尾的中间内容，例如上位机发送“&62.5&”，则显示“62.5”。",
              style: TextStyle(
                color: Color(0xff333333),
              ),
            ),
            SizedBox(height: 10),
            Text(
              "3、中间“收到数据”标签以及右侧9个按钮显示的值和按下后发送的值均可在参数设置里修改",
              style: TextStyle(
                color: Color(0xff333333),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
